package com.hxzy.consumer;

import com.hxzy.common.RabbitMQConst;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.sql.SQLOutput;

/**
 * 消费者
 */
@Component
public class MailQueueConsumer {


    /**
     * 线程1
     * @param msg
     */
    @RabbitListener(queues = {RabbitMQConst.MAIL_QUEUE})
    @RabbitHandler
    public void  receiver(String msg){
        System.out.println(Thread.currentThread().getId()+",收到消息："+msg);
        System.out.println("调用发邮件的代码");

        int i=2/0;


    }



}
